Skip to content

split in 3 competitions#283

Merged
Thykof merged 4 commits into
mainfrom
split-3-comp
Jun 18, 2026
Merged

split in 3 competitions#283
Thykof merged 4 commits into
mainfrom
split-3-comp

Conversation

@Thykof

@Thykof Thykof commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

Splits the validator's emissions model from 2 competitions (1h / 24h, keyed only on time_length) into 3 competitions, each receiving an equal 1/3 share of emissions:

Competition Assets Horizon Increment Rolling window Softmax β
Crypto 1h BTC, ETH, SOL, XRP, HYPE 1 h 1 min 5 d −0.3
Crypto 24h BTC, ETH, SOL, XRP, HYPE 24 h 5 min 10 d −0.15
Commodities/Equities 24h XAU, SPYX, NVDAX, GOOGLX, TSLAX, AAPLX, WTIOIL, SPCX 24 h 5 min 10 d −0.15

Asset changes

  • 1h timeframe: added XRP, removed XAU → now BTC, ETH, SOL, XRP, HYPE (updated on both the request-generation side HIGH_FREQUENCY.asset_list and the scoring side CRYPTO_1H).
  • 24h timeframe: added SPCX (with a matching ASSET_COEFFICIENTS weight); crypto and commodities/equities are now scored as two separate 24h competitions.

Changes

New scoring config

  • synth/validator/competition_config.py — new CompetitionConfig dataclass + the 3 competition instances and SMOOTHED_SCORE_COEFFICIENT = 1/3.
  • prompt_config.pyPromptConfig slimmed to request-scheduling only; scoring_intervals / window_days / softmax_beta / smoothed_score_coefficient moved to CompetitionConfig. HIGH_FREQUENCY / LOW_FREQUENCY asset lists updated.

Scoring pipeline

  • forward.py / neurons/validator.py — scoring and moving-average now iterate the 3 competitions; per-miner reward weights are summed across competitions, each scaled by 1/3.
  • reward.pyget_rewards_multiprocess takes the comp config; removed _get_scoring_intervals (intervals come from the competition now).
  • moving_average.pycompute_smoothed_score takes comp; uses the module-level SMOOTHED_SCORE_COEFFICIENT.
  • miner_data_handler.pyget_validator_requests_to_score and get_miner_scores now filter by the competition's asset_list (and time_length is required), so the two 24h competitions are separated by asset.

Cleanup

  • Removed the now-unused --sma.low/high.days and --softmax.low/high.beta CLI flags (config.py), their entrypoint-validator.sh vars, and the matching validator.config.js args + docs/validator_guide.md sections.
  • Removed the expired (2026-04-10) asset-slice gate in sequential_scheduler.py.
  • README.md updated to describe the 3-competition model.

Note on DB load (asset filter)

The new asset IN (...) / asset = ANY(...) predicates do not require a new index. In both scoring queries asset is a post-filter on rows already fetched by the existing access path (start_time range for the request query; scored_time range + PK joins for the scores query), over a bounded rolling window — so the predicate itself adds negligible load.

The modest cost change is structural: because Crypto 24h and Commodities/Equities 24h share time_length = 86400, the 24h window is scanned once per 24h competition, so the scoring queries run 3×/cycle instead of 2×. If profiling later shows this hot, a composite validator_requests (time_length, asset, start_time) is the candidate — but it should be validated with EXPLAIN (ANALYZE, BUFFERS) before adding, given the write cost on that table.

Tests

Updated all affected tests to the new CompetitionConfig API and the required time_length / asset_list query args:
test_forward, test_rewards, test_miner_data_handler, test_moving_average, test_moving_average_unit, test_calculate_crps, test_sequential_scheduler.

Verified locally: full touched test suite passes (testcontainers Postgres + live price history), black --check . and flake8 . clean.

🤖 Generated with Claude Code

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors validator scoring to split emissions across three competitions (Crypto 1h, Crypto 24h, Commodities/Equities 24h) by introducing a CompetitionConfig abstraction and updating scoring/moving-average pipelines, tests, and docs accordingly.

Changes:

  • Added synth/validator/competition_config.py and updated scoring logic to pass competition metadata (asset list, intervals, window, beta) through reward + moving-average computations.
  • Updated DB query paths to filter scoring/moving-average inputs by both time_length and asset_list.
  • Updated tests and documentation to reflect the new 3-competition structure and miner response format.

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
validator.config.js Removes now-deleted CLI args from PM2 validator scoring config.
tests/test_sequential_scheduler.py Updates PromptConfig construction to match removed fields.
tests/test_rewards.py Updates scoring calls to pass competition config.
tests/test_moving_average.py Updates moving-average tests to use CompetitionConfig.
tests/test_moving_average_unit.py Updates unit tests to use new competition config + coefficient constant.
tests/test_miner_data_handler.py Updates handler calls to include time_length + asset_list and competition config.
tests/test_forward.py Updates forward-path tests to use competitions and updated handler APIs.
tests/test_calculate_crps.py Updates CRPS tests to use scoring intervals from competition configs.
synth/validator/reward.py Changes reward computation to accept CompetitionConfig for scoring intervals.
synth/validator/prompt_config.py Simplifies prompt config to scheduling-related fields and updates asset lists.
synth/validator/moving_average.py Moves softmax beta to competition config and scales weights by 1/3 constant.
synth/validator/miner_data_handler.py Requires time_length and asset_list for request/score retrieval; filters by asset.
synth/validator/forward.py Iterates over 3 competitions for scoring and moving-average computation.
synth/validator/competition_config.py New: defines the three competitions and shared coefficient constant.
synth/utils/sequential_scheduler.py Removes date-gated asset slicing logic and timezone import.
synth/utils/config.py Removes deprecated CLI args for SMA windows and softmax betas.
README.md Updates competition description, miner result format example, and competition parameters.
neurons/validator.py Scores across 3 competitions in the scoring cycle.
miner.config.js Updates miner stake threshold.
entrypoint-validator.sh Removes deprecated SMA/softmax CLI args from validator startup script.
docs/validator_guide.md Removes documentation for deleted SMA/softmax CLI args.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md Outdated
Comment thread synth/validator/reward.py
Comment thread neurons/validator.py Outdated
Comment thread synth/validator/miner_data_handler.py

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 22 out of 22 changed files in this pull request and generated 3 comments.

Comment thread miner.config.js
Comment thread synth/validator/forward.py Outdated
Comment thread neurons/validator.py Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 33 out of 33 changed files in this pull request and generated 3 comments.

Comment thread verify/pyth-lazer-listing.py
Comment thread tests/test_price_data_provider.py
Comment thread miner.config.js
@Thykof Thykof merged commit bf17914 into main Jun 18, 2026
6 checks passed
@Thykof Thykof deleted the split-3-comp branch June 18, 2026 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants